# reference: 20190526_svd.ipynb

import pandas as pd
import numpy as np
import scipy as sp
from PIL import Image, ImageShow
import matplotlib.pyplot as plt

path = './data/lena.jpg'
girl = Image.open(path)
girl_arr = np.array(girl)
print(girl_arr.shape)
print(girl_arr.dtype)
fig, axes = plt.subplots(2,2,figsize=(7,7))
axes[0][0].imshow(girl_arr)
axes[0][0].set_title('orignal')
axes[0][1].imshow(girl_arr[:, :, 0], plt.cm.gray)
axes[0][1].set_title("R")
axes[1][0].imshow(girl_arr[:, :, 1], plt.cm.gray)
axes[1][0].set_title("G")
axes[1][1].imshow(girl_arr[:, :, 2], plt.cm.gray)
axes[1][1].set_title("B")
fig.savefig("4.21-girlchannel.png")